package com.ruoyi.web.controller.videoabalysis;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.points.domain.VideoPoints;
import com.ruoyi.points.domain.VideoPointsLogs;
import com.ruoyi.points.service.IVideoPointsLogsService;
import com.ruoyi.points.service.IVideoPointsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;

/**
 * 视频解析Controller
 * 
 * @author ruoyi
 * @date 2025-03-07
 */
@RestController
@RequestMapping("/video-point")
public class WebPointController extends BaseController {
    @Autowired
    private IVideoPointsService pointsService;

    @Autowired
    private IVideoPointsLogsService pointsLogsService;

    /**
     * 查询视频解析列表
     */
//    @PreAuthorize("@ss.hasPermi('video:VideoAnalysis:list')")
    @GetMapping("/list")
    public TableDataInfo list(VideoPointsLogs points) {
        startPage();
        points.setUserId(getUserId());
        List<VideoPointsLogs> listView = pointsLogsService.selectVideoPointsLogsList(points);
        return getDataTable(listView);
    }

    /**
     * 获取视频解析详细信息
     */
//    @PreAuthorize("@ss.hasPermi('video:VideoAnalysis:query')")
    @GetMapping(value = "/item")
    public AjaxResult getInfo() {
        VideoPoints points = pointsService.selectVideoPointsByUserId(getUserId());
        return success(points.getPoints());
    }

}